package org.fgtv.gospel.user.dao;

import java.util.List;

import org.fgtv.gospel.domain.User;
import org.springframework.orm.ibatis.SqlMapClientTemplate;

public class UserDaoIBatis implements UserDao {
	
	private SqlMapClientTemplate sqlMapClientTemplate;

	/**
	 * @param sqlMapClientTemplate the sqlMapClientTemplate to set
	 */
	public void setSqlMapClientTemplate(SqlMapClientTemplate sqlMapClientTemplate) {
		this.sqlMapClientTemplate = sqlMapClientTemplate;
	}

	@Override
	public void add(User user) {
		sqlMapClientTemplate.insert("insertUser", user);
	}

	@Override
	public User get(String userId) {
		return (User) sqlMapClientTemplate.queryForObject("findUserById", userId);
	}

	@Override
	public List<User> getAll() {
		return sqlMapClientTemplate.queryForList("findUsers");
	}

	@Override
	public void deleteAll() {
		sqlMapClientTemplate.delete("deleteUserAll");
	}

	@Override
	public int getCount() {
		// TODO Auto-generated method stub
		return 0;
	}

	@Override
	public void update(User user) {
		// TODO Auto-generated method stub

	}

}
